package com.ourway.dtos;

import cn.hutool.core.annotation.Alias;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.util.Assert;

import java.io.Serializable;

/**
 * 飞书删除用户业务信息
 *
 * @author liuweiheng
 * @since 2021/12/12
 */
@Data
@Builder
public class FeiShuUserDeleteDTO implements Serializable {

    private String userId;

    @JsonProperty("department_chat_acceptor_user_id")
    @Alias("department_chat_acceptor_user_id")
    private String departmentChatAcceptorUserId;

    @JsonProperty("external_chat_acceptor_user_id")
    @Alias("external_chat_acceptor_user_id")
    private String externalChatAcceptorUserId;

    @JsonProperty("docs_acceptor_user_id")
    @Alias("docs_acceptor_user_id")
    private String docsAcceptorUserId;

    @JsonProperty("calendar_acceptor_user_id")
    @Alias("calendar_acceptor_user_id")
    private String calendarAcceptorUserId;

    @JsonProperty("application_acceptor_user_id")
    @Alias("application_acceptor_user_id")
    private String applicationAcceptorUserId;

    @JsonProperty("helpdesk_acceptor_user_id")
    @Alias("helpdesk_acceptor_user_id")
    private String helpdeskAcceptorUserId;

    public static FeiShuUserDeleteDTO init(String userId, String acceptorUserId) {
        Assert.notNull(acceptorUserId, "Illegal Argument: acceptorUserId");
        return FeiShuUserDeleteDTO.builder()
                .userId(userId)
                .departmentChatAcceptorUserId(acceptorUserId)
                .externalChatAcceptorUserId(acceptorUserId)
                .docsAcceptorUserId(acceptorUserId)
                .calendarAcceptorUserId(acceptorUserId)
                .applicationAcceptorUserId(acceptorUserId)
                .helpdeskAcceptorUserId(acceptorUserId).build();
    }
}
